package com.enki.cigarettes.enums;

/**
 * @author WCS.Wang
 * @version V1.0
 * @Package com.enki.cigarettes.enums
 * @Name aec-middle-admin-api-module
 * @Description: TODO (用一句话描述该文件做什么)
 * @date 2018/10/15
 */
public class CouponEnums {

    /**
     * 优惠券类型
     */
    public enum CouponType {
        COUPON("优惠券", 0), DISCOUNT("折扣券", 1);

        private String name;
        private int type;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getType() {
            return type;
        }

        public void setType(int type) {
            this.type = type;
        }

        CouponType(String name, int type) {
            this.name = name;
            this.type = type;
        }

        public static String getName(int type) {
            for (CouponType ct : CouponType.values()) {
                if (ct.getType() == type) {
                    return ct.getName();
                }
            }
            return "";
        }
    }


    /**
     * 使用范围
     */
    public enum CouponScope {

        ALL("全场通用优惠券", 0), STORE("店铺优惠券", 1), CATEGORY("品类", 2);

        private String name;
        private int scope;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getScope() {
            return scope;
        }

        public void setScope(int scope) {
            this.scope = scope;
        }

        CouponScope(String name, int scope) {
            this.name = name;
            this.scope = scope;
        }

        public static String getName(int scope) {
            for (CouponScope ct : CouponScope.values()) {
                if (ct.getScope() == scope) {
                    return ct.getName();
                }
            }
            return "";
        }
    }

    /**
     * 限领张数
     */
    public enum CouponStint {
        INFINITE("不限量",-1);

        private String name;
        private int stint;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getStint() {
            return stint;
        }

        public void setStint(int stint) {
            this.stint = stint;
        }

        CouponStint(String name, int stint) {
            this.name = name;
            this.stint = stint;
        }

        public static String getName(int stint) {
            for (CouponStint cs : CouponStint.values()) {
                if (cs.getStint() == stint) {
                    return cs.getName();
                }
            }
            return "";
        }
    }


}
